library(DeclareDesign)
library(rdss)
library(tidyverse)


diagnosis_17.5 <- read_rds("diagnosis_objects/diagnosis_17.5.rds")

gg_df <-
  diagnosis_17.5 |>
  tidy() |>
  filter(diagnosand == "bias") |>
  mutate(deceive = factor(
    deceive,
    c(TRUE, FALSE),
    c("With deception", "Without deception")
  ))

g <-
  ggplot(gg_df) + 
  aes(deceive, estimate) +
  geom_point() + 
  geom_pointrange(aes(ymin = conf.low, ymax = conf.high)) +
  labs(y = "Diagnosand: Bias") +
  theme_dd() +
  theme(axis.title.x = element_blank()) +
  facet_grid(.~inquiry) 

g
ggsave("figures/figure_17.5.pdf", g, width = 6.5, height = 3.5)
ggsave("figures/figure_17.5.svg", g, width = 6.5, height = 3.5)



